package com.hadoop.project.mvc.mappers;

import com.hadoop.project.entity.po.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface UserMapper extends BaseMapper<User, User> {

    /**
     * 根据邮箱查询用户
     *
     * @param userEmail
     * @return
     */
    @Select("select * from user where email = #{userEmail}")
    User getByEmail(String userEmail);

    /**
     * 注册用户
     *
     * @param user
     */
    Long insertUser(User user);

    /**
     * 修改密码
     *
     * @param user
     */
    @Update("update user set password = #{password} where email = #{email}")
    void updataPassword(User user);

    /**
     * 添加密码
     *
     * @param user
     */
    void updateInfo(User user);
}
